fix(coverage): intercept .output, which was read whole - #24
Merged
Conversation
…st stopped one word short `.out` was in LOG_EXTS and `.output` was not. Extension matching is exact, so `.output` never matched `out` and every build or test run redirected to one was read whole — 54 recorded reads, 9,547 tokens at or above the threshold. The list lives in three places (lumen_core::coverage::LOG_EXTS, INTERCEPT_TEMPLATE, and the repo's developer hook) and the word was missing from all of them, because nothing compared the shell copies to the constant. The new drift test drives its assertion from the constant, so the next addition cannot land in one copy only. One trap while writing it: `out|` is a substring of `output|`, so a `contains` check would report `.out` as routed even if only `.output` were present. The arm is split on its own delimiters instead. Tests, per the rule that every fix carries all four: unit - classify() for .output, the whole LOG_EXTS set, and .outputs staying out drift - both intercept copies route every extension in the constant e2e - the generated hook run for real against a 400-line .output: exits 2 and names compress_logs bench - a new scenario, 13,842 -> 1,062 tokens (92.3% saved) No existing benchmark scenario moved: the baseline diff is nine added lines and nothing else.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #10.
.outwas in the log extension list,.outputwas not. Matching is exact, so.outputnevermatched
outand those files were read whole — 54 reads, 9,547 tokens above the threshold.The word was missing from all three copies of the list (the
coverage::LOG_EXTSconstant, theshipped hook template, and the repo's developer hook) because nothing compared the shell copies to
the constant. The new drift test drives its assertion from the constant, so the next addition can't
land in one copy only.
Optimizer comparison
.outputfile, beforeNo existing scenario changed. The baseline diff is 9 added lines, nothing removed or modified —
checked programmatically, not by eye:
Tests
classify()for.output, the wholeLOG_EXTSset, and.outputsstaying out.output: exits 2 and namescompress_logsoptimizer_benchOne trap worth noting:
out|is a substring ofoutput|, so acontainscheck would have reported.outas routed even if only.outputwere present. The test splits the case arm on its owndelimiters instead.
Local gate green before pushing.